package com.gxuwz.util;

import com.gxuwz.entity.WebResult;
import com.gxuwz.enums.WebResultEnum;

/**
 * Created by h on 2017/12/4.
 */
public class WebResultUtil {

    public static WebResult success(Object object){
        WebResult result = new WebResult();
        result.setCode(WebResultEnum.SUCCESS.getCode());
        result.setMessage(WebResultEnum.SUCCESS.getMessage());
        result.setData(object);
        return result;
    }

    public static WebResult success(){
        return success(null);
    }

    public static WebResult error(Integer code,String message){
        WebResult result = new WebResult();
        result.setCode(code);
        result.setMessage(message);
        return result;
    }

}
